<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var i = 0;
        var sum = 0;
        for(var a =100000;a>50000;a*=0.95){
            sum=(a*0.05).toFixed(2);
            // a=(a*=0.95).toFixed(2);
            document.write("拥有"+a.toFixed(2)+"<br>")
            document.write("缴费"+sum+"<br><br>")
            i++;
        }
        document.write(i+"<br><br>")



        for(;a<=50000 && a>0;a-=5000){
            document.write("拥有"+a.toFixed(2)+"<br>")
            if(a>=5000){
                document.write("缴费"+5000+"<br>")
                i++;
            }else{
                document.write("不足以缴费<br>")
                document.write(i+"<br><br>")
                alert("此人可以经过"+i+"次这个路口")
            }
        }
        
        
    </script>
</head>
<body>
    
</body>
</html>